package com.jianzong.lingxuan.rabbitmq;

import cn.hutool.core.date.DateUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @auth Leiwenlong
 * @since 2021/11/6
 *   提供者
 */
@Component
@Slf4j
public class RabbitProvider {

    @Autowired
    private AmqpTemplate amqpTemplate;

    public void send(){
        String msg = DateUtil.date()+ "-执行任务";
        log.info("发送消息");
        amqpTemplate.convertAndSend("testQuery",msg);
    }
}
